class ElementViewManager extends egret.EventDispatcher {
    private _layer: egret.Sprite; // 元素存在的容器
    constructor(elementLayer: egret.Sprite) {
        super();
        this._layer = elementLayer;
        this.init();
    }

    // ------- 初始化数据 ------
    // ElementView对象池，全局仅最多GameData.MaxRow*GameData.MaxColumn个，默认64个
    private elementviews: ElementView[];

    // 初始化所有数据变量
    private init() {
        this.elementviews = new Array();
        let l: number = GameData.MaxRow * GameData.MaxColumn;
        let el: ElementView;
        for (let i = 0; i < l; i++) {
            el = new ElementView(this._layer);
            el.id = i;
            el.location = GameData.elements[i].location;

            this.elementviews.push(el);
            el.addEventListener(ElementViewManagerEvent.REMOVE_ANIMATION_OVER, this.removeAniOver, this);
            el.addEventListener(egret.TouchEvent.TOUCH_TAP, this.elTap, this);
            el.addEventListener(ElementViewManagerEvent.UPDATE_MAP, this.updataMap, this);
            el.addEventListener(ElementViewManagerEvent.UPDATE_VIEW_OVER, this.moveNewLocationOver, this);
        }
    }

    // ------- 焦点相关控制 -------
    private _currentTapID: number = -1; // 当前被点击（即将获取焦点）的元素ID，如为-1则表示没有元素获取焦点

    // 元素被点击响应事件
    // 判断当前元素焦点状态，是否需要改变，如果存在两个焦点，则触发TAP_TWO_ELEMENT，通知上层逻辑，对
    private elTap(evt: egret.TouchEvent) {
        if (PropViewManager.proptype == -1) { // 无道具激活
            if (evt.currentTarget instanceof ElementView) {
                let ev: ElementView = <ElementView>evt.currentTarget;
                if(this.)
            }
        }
    }



}